using System;
using System.IO;

namespace UraniaLib
{
	/// <summary>
	/// Summary description for UraniaCLineData.
	/// </summary>
	public class UraniaCLineData
	{
		public DateTime dEpoch = new DateTime(2000, 1, 1);

		public double[] fFromDecl;
		public double[] fFromRA;
		public double[] fToDecl;
		public double[] fToRA;
		public string[] sConst;
		public long lCLineCount;

		public UraniaCLineData()
		{
			FileStream oFile = new FileStream("data\\clines.dat", FileMode.OpenOrCreate, FileAccess.Read);
			StreamReader oRead = new StreamReader(oFile);
			string sLine = "";
			string[] aLine;
			long i;
			lCLineCount = 340;

			fFromDecl = new double[lCLineCount];
			fFromRA = new double[lCLineCount];
			fToDecl = new double[lCLineCount];
			fToRA = new double[lCLineCount];
			sConst = new string[lCLineCount];

			if (oFile.Length > 1)
			{
				for (i = 0; i < lCLineCount; i++)
				{
					sLine = oRead.ReadLine();

					aLine = sLine.Split(',');
					sConst[i] = aLine[0].Trim(); 
					fFromRA[i] = Convert.ToDouble(aLine[1].Trim()); 
					fFromDecl[i] = Convert.ToDouble(aLine[2].Trim()); 
					fToRA[i] = Convert.ToDouble(aLine[3].Trim()); 
					fToDecl[i] = Convert.ToDouble(aLine[4].Trim()); 
				}
			}
			oRead.Close();
			oFile.Close();
		}
	}
}
